<template>
  <div class="Specialtreatment">
    <van-cell-group>
      <van-cell title="是否手术"
                :value="operationMsg.operationName?'是':'否'"
                :label="operationMsg.operationName?operationMsg.operationName:'无'"/>
      <template v-for="item in specialDrugs">
        <van-cell :title="item.st_Name?item.st_Name:'无'"
                  :value="item.st_Name?'是':''"/>
      </template>
    </van-cell-group>
  </div>
</template>

<script>
import {mapGetters} from "vuex";

export default {
  name: 'Specialtreatment',
  computed: {...mapGetters(['userPhone'])},
  data() {
    return {
      operationMsg: '',//手术信息
      specialDrugs: ''//特殊药物
    }
  },
  mounted() {
    this.getOperationMsg();
    this.getSpecialDrugs();
  },
  methods: {
    //特殊药物
    getSpecialDrugs() {
      this.$service.medicalHistoryService.getSpecialTreatment(this.userPhone).then(res => {
        this.specialDrugs = res.data.data;
        console.log('特殊药物=' + JSON.stringify(this.specialDrugs));
      })
    },
    //手术
    getOperationMsg() {
      this.$service.medicalHistoryService.getOperationMsg(this.userPhone).then(res => {
        this.operationMsg = res.data.data[0];
        console.log('手术信息=' + JSON.stringify(this.operationMsg));
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
